<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>快照对比页面,情绪计算</title>
<style type="text/css">
table.gridtable {
	font-family: verdana, arial, sans-serif;
	font-size: 11px;
	color: #333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}

table.gridtable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #dedede;
}

table.gridtable td {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #ffffff;
}

tr:hover td {
	background: none;
}

tr:hover {
	background-color: none;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  padding: 8px;
  text-align: left;
}

th {
  background-color: #f2f2f2;
}
#myDiv { 
     top: 0px;
     right: 0;
     background-color: #f1f1f1;
     padding: 10px;
     overflow-y:auto;
   }
</style>
<meta charset="UTF-8">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/grid1.0.js"></script>
</head>
<body style="overflow:auto;">
<select id="spselect">
	<option></option>
</select>
<div id="myDiv"></div>
<script type="text/javascript">
(function(){ 
	
	function load(){
		$.ajax({
			type : "get",
			url : "${pageContext.request.contextPath}/getdisSp", 
			data:{date1:$("#date2").val()},
			dataType:'json',
			success : function(msg) {  
				for (var i = 0; i < msg.length; i++) {
					 $("#spselect").append("<option>"+msg[i]+"</option>");
				} 
			}
		});
	}
	function loadUrl(){
		$('table tr').each(function() {
		    var thirdColumn = $(this).find('td:eq(2)');
		    var linkText = thirdColumn.text();  
		    thirdColumn.html('<a href=http://quote.eastmoney.com/concept/'+linkText+'.html target="_blank">' + linkText + '</a>');
		 });
	}
	$("#spselect").change(function(){ 
		var selectedValue = $('#spselect option:selected').val();
		$.ajax({
			type : "get",
			url : "${pageContext.request.contextPath}/getsp", 
			data:{sp:selectedValue},
			dataType:'text',
			success : function(msg) {  
				console.log(msg);
				 $("#myDiv").html(msg);
				 $("#mytalbe").addClass("gridtable");  
				 loadUrl();
			}
		});
	});
	load();
})();
  
</script>

</body>
</html>